package cn.cfoodc.sharding.service.impl;

import cn.cfoodc.sharding.domain.Encryptor;
import cn.cfoodc.sharding.mapper.EncryptorMapper;
import cn.cfoodc.sharding.service.EncryptorService;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EncryptorServiceImpl implements EncryptorService {

    private EncryptorMapper encryptorMapper;
    @Autowired
    public EncryptorServiceImpl(EncryptorMapper encryptorMapper){
        this.encryptorMapper=encryptorMapper;
    }


    @Override
    public int insert(Encryptor encryptor) {
        return encryptorMapper.insert(encryptor);
    }

    @Override
    public List<Exception> selectAll() {
        return encryptorMapper.selectAll();
    }

    @Override
    public List<Exception> selectEncryptorAndArgs_1(String name, String publicKey) {
        return encryptorMapper.selectEncryptorAndArgs_1(name , publicKey);
    }

    @Override
    public List<Exception> selectEncryptorAndArgs_2(String name, String pwd) {
        return encryptorMapper.selectEncryptorAndArgs_2(name , pwd);
    }

    @Override
    public Encryptor selectByPrimaryKey(Long id) {
        return encryptorMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKey(Encryptor encryptor) {
        return encryptorMapper.updateByPrimaryKey(encryptor);
    }

    @Override
    public int deleteByPrimaryKey(Long id , String name ,String publicKey ) {
        return encryptorMapper.deleteByPrimaryKey(id,name,publicKey);
    }

}
